<%--
 *  File:    DistributortenderSummary.jsp
 *  @Author: only jin
 *  Date:    2009/10/22
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval"%>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom"%>

<iframe name="reloadHandler" style="display:none"></iframe>
<%//init param
			Category cat = Category.getInstance("jsp.OrgEdit");
			String strPrivCode = (String) request.getParameter("third");
			if (strPrivCode == null)
				strPrivCode = (String) session.getAttribute("third");
			if (strPrivCode == null)
				strPrivCode = "";
			String privilegeCode = strPrivCode;
			String strModuleName = "OGM";
			String contextPath = request.getContextPath();

			%>



<%@ include file="/inc/Security.inc"%>
<%@ include file="/inc/PageDefault.inc"%>

<html>
<head>
<title>doctorInfoMain.jsp</title>

<PageFlow:CheckPageFlow pageName="p_distributortenderedit" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css"
	type="text/css">
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/Calendar.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<script language="JavaScript">



function setcontactname(contantelement){

	var code = contantelement.value;
  	var  datahandler = new  DataHandler() ;
  	datahandler.add_params("contactcode" , code,"string") ;
  	datahandler.add_params("languagecode" , 'cn',"string") ;
  	
  	datahandler.getResultFromHashMap("contactinfo" ,"contactcode" ,"document.frm.contactcode");
  	datahandler.getResultFromHashMap("contactinfo" ,"contactname" ,"document.frm.contactname");
  	datahandler.getResultFromHashMap("contactinfo" ,"contactid" ,"document.frm.contactid");
  	
  	datahandler.add_job("j_distributortenderedit") ;
    datahandler.runDataHandler ();
}
function set_contactNameByPopWindow(id,name,code){
	
	document.frm.contactcode.value=code;
	document.frm.contactname.value=name;
	document.frm.contactid.value=id;

}


function sethospitalname(contantelement){

	var code = contantelement.value;
  	var  datahandler = new  DataHandler() ;
  	datahandler.add_params("orgcode" , code,"string") ;
  	datahandler.add_params("languagecode" , 'cn',"string") ;
  	
  	datahandler.getResultFromHashMap("hospitalinfo" ,"orgcode" ,"document.frm.orgcode");
  	datahandler.getResultFromHashMap("hospitalinfo" ,"orgname" ,"document.frm.orgname");
  	datahandler.getResultFromHashMap("hospitalinfo" ,"orgid" ,"document.frm.orgid");
  	
  	datahandler.add_job("j_distributortenderedit") ;
    datahandler.runDataHandler ();
}

function set_orgNameByPopWindow(id,name,code){
	
	document.frm.orgcode.value=code;
	document.frm.orgname.value=name;
	document.frm.businessorgid.value=id;

}


function page_popwindow(){
  	if(popwindow!=null)
    	popwindow.close();
  	var strurl="<%=contextPath%>/masterdata/ogm/BusiAreaTreePop.jsp?<%= OvalTools.randomURL()%>&languagecode=<%=strLanguageCode%>"; 
  	var strStatus= "height=400,width=260,top=100,left=100,toolbar=n0, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
 	popwindow=window.open(strurl, "newwindow",strStatus);
}

function page_setBusinessArea(id,areaname,parentid){
  	frm.areaid.value=id;
  	frm.areaname.value=areaname;
}

function popWindowShowContactPage(){
	var url = "<%=contextPath%>/masterdata/ogm/popWindowContactInfo.jsp?"+"<%= OvalTools.randomURL() %>"+"&orgid=1&languagecode=<%=strLanguageCode%>";
	var windowAttribute = "height=250, width=400,top=100,left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";
	if(popwindow!=null)
    popwindow.close();
    
  	popwindow = window.open(url,'ContactInfo',windowAttribute);
}

function popWindowShowHospitalPage(){
    
	var url = "<%=contextPath%>/masterdata/ogm/OrgPopWindow.jsp?"+"threadxcnt=0.06165288538971159"+"&orgid=1&languagecode=cn";
	var windowAttribute = "height=250, width=400,top=100,left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";

  	if(popwindow!=null)
    
    popwindow.close();
    
  	popwindow = window.open(url,'hospitalinfo',windowAttribute);
  	


}


	

	
	function page_return(){
		
		parent.location.href="DistributortenderSummary.jsp?<%= OvalTools.randomURL() %>";
		
	}

	
function page_done()
{
  if(!checkForm(frm)) return; 	
  if(!isNumeric(frm.amount.value))  {
	 alert("<%= message.getMessageDesc("Amount_Enter_The_Number_Must_Be") %>");
	 RETURN;  
  }; 

  if(!isNumeric(frm.tenderprice.value))  {
	 alert("<%= message.getMessageDesc("Tender_Price_Enter_The_Number_Must_Be") %>");
	 RETURN;  
  }; 

  
  if(!isNumeric(frm.historytenderprice.value))  {
	 alert("<%= message.getMessageDesc("History_Tender_Price_Enter_The_Number_Must_Be") %>");
	 RETURN;  
  }; 
  
  if(!isNumeric(frm.bidprice.value))  {
	 alert("<%= message.getMessageDesc("Bid_Price_Enter_The_Number_Must_Be") %>");
	 RETURN;  
  }; 


  
  document.frm.actionname.value="save";
  document.frm.target="_parent";
  isRunning = true;
  document.frm.submit();
}


function popSelectProductWindow(){
	//var url = "<%=contextPath%>/devlop/distributortender/ProdPopWindow.jsp?"+"threadxcnt=0.06165288538971159"+"&orgid=1&languagecode=cn";
	
	var id=document.frm.distributortenderid.value;
	var url = "<%=contextPath%>/devlop/distributortender/DistributortenderProdInfo.jsp?"+"threadxcnt=0.06165288538971159"+"&distributortenderid="+id+"&orgid=1&languagecode=cn";
	var windowAttribute = "height=500, width=800,top=100,left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";
  	if(popwindow!=null)
    popwindow.close();
  	popwindow = window.open(url,'hospitalinfo',windowAttribute);
}

function popSelectAreaWindow(){
	var id=document.frm.distributortenderid.value;
	var url = "<%=contextPath%>/devlop/distributortender/DistributortenderAreaInfo.jsp?&distributortenderid="+id+"&orgid=1&languagecode=cn";
	var windowAttribute = "height=300, width=600,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no";
  	if(popwindow!=null)
    popwindow.close();
  	popwindow = window.open(url,'hospitalinfo',windowAttribute);
}


</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td class="summary_top"></td>
	</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
	<form name="frm" method="post" action="../../Dispatcher"><input
		type="hidden" name="pagename" value="p_distributortenderedit"> <input
		type="hidden" name="actionname">
	<custom:hidden property="orgid" name="userinfo" scope="session"/>
	<custom:hidden property="userid" changedName="maker" name="userinfo" scope="session"/>
	<custom:hidden property="distributortenderid" name="distributortenderinfo" />
	<tr>
		<td valign="top">
		<table border="1" cellspacing="0" bordercolorlight="#999999"
			bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="1">
			<span id="editbody">
			<tr>
				<td colspan="4" class="deepblue-left"><img
					src="../../images/<%= strLanguageCode %>/quote.gif">
			</tr>
			<%boolean isAuto = pageContext.getAttribute("isauto") != null
					&& pageContext.getAttribute("isauto").toString()
							.equalsIgnoreCase("Y");
			String codeClass = isAuto ? "td-text" : "need";
			String codeIsNull = isAuto ? "Y" : "N";
			String codeISDisabled = isAuto ? "true" : "false";

			%>
						
						<%
				 HashMap distributortenderinfo = (HashMap)pageContext.getAttribute("distributortenderinfo");
				 if(distributortenderinfo == null)
				  {
					 distributortenderinfo = new HashMap();
				  }
			%>
			<!-- --------------------------Row No: 1-------------------------------------- -->
			<tr>
				<td class="need"><%=label.getLabelName("L_DistributortenderCode") + label.getLabelName("L_Colon")%></td>
				<td>
					<custom:write name="distributortenderinfo" property="distributortendercode" nbsp="true"/>
				</td>
				<td class="need"><%=label.getLabelName("L_DistributortenderName") + label.getLabelName("L_Colon")%></td>
				<td>
					<custom:write name="distributortenderinfo" property="distributortendername"  nbsp="true"/>
				</td>
			</tr>
			<!-- --------------------------Row No: 2-------------------------------------- -->
			<tr>			
				<td class="need"><%=label.getLabelName("L_Bid") +label.getLabelName("L_Region") +label.getLabelName("L_Colon")%></td>
				<!-- 
				<td><a onclick="javascript:popSelectAreaWindow();">
					<custom:button type="3" label="L_Asterisk" imgsrc="flash.gif"	border="0" /></a>
				</td>
				 -->
				<td>
					<custom:write name="distributortenderinfo" property="disareaname"  nbsp="true"/>
				</td>
				<td class="need"><%=label.getLabelName("L_Status") + label.getLabelName("L_Colon")%></td>
				<td>
					<custom:selectdic name="distributortenderinfo" property="status" dictType="Status" valueCriteria="111,112" defaultValueCost=" " disabled="true"/>
				</td>
			</tr>
			<!-- --------------------------Row No: 3-------------------------------------- -->
			<tr>
				<td class="need"><%=label.getLabelName("L_DistributortenderStartDate")+ label.getLabelName("L_Colon")%></td>
				<td>
					<custom:write name="distributortenderinfo" property="begindate" nbsp="true"/>
				</td>
				
				
				<td class="need"><%=label.getLabelName("L_TenderType")+ label.getLabelName("L_Colon")%></td>
				<td><custom:select name="distributortenderinfo" property="tenderconfigid" optionsName="configs" command="notnull" 
				label="L_AgreementType" optionValueKey="tenderconfigid" optionInnerTextKey="tenderconfigname"   defaultValueCost="" disabled="true"/> 
				</td>
			</tr>
			<!-- --------------------------Row No: 4-------------------------------------- -->
			<tr>
				<td class="need"><%=label.getLabelName("L_Purchase")+ label.getLabelName("L_Cycle")+label.getLabelName("L_Colon")%></td>
				<td><custom:write name="distributortenderinfo" property="purchasecycle"  nbsp="true" /></td>
				<td class="td-text"><%=label.getLabelName("L_Amount1")+ label.getLabelName("L_Colon")%></td>
				<td><custom:write name="distributortenderinfo" property="amount" nbsp="true"/></td>
			</tr>
			<!-- --------------------------Row No: 5-------------------------------------- -->
			<tr>
			   <td class="td-text"><%=label.getLabelName("L_ContactId") + label.getLabelName("L_Colon")%></td>
         		<td>
					<custom:hidden  name="distributortenderinfo" property="contactid"/>
					<%if(distributortenderinfo.get("username")!=null){%>
			           	<custom:write name="distributortenderinfo" property="username"/>&nbsp;
			           	<custom:hidden name="distributortenderinfo" property="usergroupname" />
					<%}else{ %>
			           	<custom:write name="distributortenderinfo" property="usergroupname"/>&nbsp;
			           	<custom:hidden name="distributortenderinfo" property="username" />
					<%} %>
		           	<custom:hidden name="distributortenderinfo" property="station"/>
         		</td>
				<td class="need"><%=label.getLabelName("L_Report1") +label.getLabelName("L_Province") +label.getLabelName("L_Colon")%></td>
				<td>
					<custom:hidden property="disregionid"  name="distributortenderinfo"/>
		           	<custom:write property="areaname" name="distributortenderinfo"/>&nbsp;
				</td>
			</tr>
			<!-- --------------------------Row No: 6-------------------------------------- -->
			<tr>
            <td class="td-text"><%=label.getLabelName("L_Drugs") + label.getLabelName("L_Colon")%></td>
         		<td>
					<custom:select name="distributortenderinfo" property="dictionaryid" optionsName="dictionarys" 
				    optionValueKey="dictionaryid" optionInnerTextKey="valuename"   defaultValueCost="" disabled="true"/> 
         		</td>
				<td class="td-text">&nbsp;</td>
				<td>
					&nbsp;
				</td>
			</tr>
			<!-- --------------------------Row No: 7-------------------------------------- -->

			<tr>
				<td class="td-text"><%=label.getLabelName("L_Instance") + label.getLabelName("L_Colon")%></td>
				<td colspan="3">
					<custom:write name="distributortenderinfo" property="instance" nbsp="true"/>
				</td>
			</tr>


			<%--2003-5-16 11:14 kent add end--%>
		</table>
		</td>
	</tr>
	<!-- --------------------------Row No:9-------------------------------------- -->
	<tr>
		<td class="summary_top"></td>
	</tr>
	<tr>
		<td height="49" class="td_center">
		<%if(pageContext.getAttribute("totalsummary")!=null){%>		
			<a onclick="page_done()"><custom:button type="1" label="L_Save" imgsrc="finish.gif" border="0" style="width:60" /></a>
		<%} %>
			<a onclick="page_return()"><custom:button type="1" label="L_Back" border="0"  imgsrc="finish.gif" style="width:60" /></a>
		</td>
	</tr>

</table>

</body>
</html>



